package com.kexun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kexun.entity.SongInfo;
import com.kexun.service.SongInfoService;
import com.kexun.mapper.SongInfoMapper;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class SongInfoServiceImpl extends ServiceImpl<SongInfoMapper, SongInfo>
        implements SongInfoService {

    @Override
    public boolean findExist(String songName, String singer, String albumName) {
        QueryWrapper<SongInfo> w = new QueryWrapper<>();
        w.eq("song_name", songName);
        w.eq("album_name", albumName);
        w.eq("singer_name", songName);

        return baseMapper.selectCount(w) > 0;
    }
}




